<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddDeletedAtToAdminUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('admin_users', function (Blueprint $table) {
            if(!Schema::hasColumn('admin_users', 'deleted_at')){
                $table->timestamp('deleted_at');
            }
        });
        Schema::table('point_goods_orders', function (Blueprint $table) {
            if(!Schema::hasColumn('point_goods_orders', 'deleted_at')){
                $table->timestamp('deleted_at');
            }
        });
        Schema::table('goods_to_materials', function (Blueprint $table) {
            if(!Schema::hasColumn('goods_to_materials', 'deleted_at')){
                $table->timestamp('deleted_at');
            }
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('admin_users', function (Blueprint $table) {
            //
        });
    }
}
